<?php
include("../../config/config.php");
$identifier = array_key_exists("id",$_GET)?$_GET["id"]:"";
$id = "$identifier";
$login = "";
$pass = "";
$email = "";
$first_name = "";
$last_name = "";
$level_id = "";
$enabled = "";
$updated_on = "";
$created_on = "";

if ($identifier != ""){
	// EDIT ITEM
	$action = "EDITAR";

	$DM->loadClass("fw","FwUser");
	$object_FwUser = new FwUser();
	$object_FwUser->id = $identifier;
	$object_FwUser->getById();
	$id = $object_FwUser->id;
	$login = $object_FwUser->login;
	$pass = $object_FwUser->pass;
	$email = $object_FwUser->email;
	$first_name = $object_FwUser->first_name;
	$last_name = $object_FwUser->last_name;
	$level_id = $object_FwUser->level_id;
	$enabled = $object_FwUser->enabled;
	$updated_on = $object_FwUser->updated_on;
	$created_on = $object_FwUser->created_on;

}
?>
<html>
<HEAD>
	<link href="<?php echo HTTP_BASE?>/resource/includes/css/admin.css" type="text/css" rel="stylesheet" rev="stylesheet" />
	<script src="<?php echo HTTP_BASE?>/resource/includes/javascript/jquery/jquery-1.2.3.js"></script>
	<script>
		function checkFilled(){
			mySubmit();
		}
		function comboFix(comboName,value){
			var k = document.cont;
			var cm = k[comboName];
			for (var i=0;i<cm.length;i++){
				if (cm[i].value==value){
					cm.selectedIndex=i;
				}
			}
		}
	</script>
</HEAD>
<body bgcolor='#FFFFFF' onload="">	<form action="FwUser.process.php" method="POST" enctype="multipart/form-data" name="cont">
	<table width='100%' cellpadding="3" cellspacing="1" bgcolor="#efefef">
		<tr>
			<td class='titleTd' bgcolor='#ffffff' width="25">FWUSER</td>
			<td class='titleTd' bgcolor='#ffffff'><font style='font-wheight:bolder;font-size:11px;'><?php echo $action?></font>
				<input type="hidden" name="id" value="<?php echo $id?>">
			</td>
		</tr>
		<tr>
			<td colspan="2" class='titleTd' bgcolor='#ffffff'>FORM</td>
		</tr>
		<tr>
			<td colspan="2" height="20">&nbsp;</td>
		</tr>
		<tr>
			<td class='line1'>ID</td>
			<td class='line1'><input type="text"   size="10" class='inputClass' name="id" value="<?php echo $id?>"></td>
		</tr>
		<tr>
			<td class='line2'>Login</td>
			<td class='line2'><input type="text"  MAXLENGTH="60"  style="width:180px;" class='inputClass' name="login" value="<?php echo $login?>"></td>
		</tr>
		<tr>
			<td class='line1'>Password</td>
			<td class='line1'><input type="text"  MAXLENGTH="32"  style="width:96px;" class='inputClass' name="pass" value="<?php echo $pass?>"></td>
		</tr>
		<tr>
			<td class='line2'>E-mail</td>
			<td class='line2'><input type="text"  MAXLENGTH="200"  style="width:600px;" class='inputClass' name="email" value="<?php echo $email?>"></td>
		</tr>
		<tr>
			<td class='line1'>First Name</td>
			<td class='line1'><input type="text"  MAXLENGTH="200"  style="width:600px;" class='inputClass' name="first_name" value="<?php echo $first_name?>"></td>
		</tr>
		<tr>
			<td class='line2'>Last Name</td>
			<td class='line2'><input type="text"  MAXLENGTH="200"  style="width:600px;" class='inputClass' name="last_name" value="<?php echo $last_name?>"></td>
		</tr>
		<tr>
			<td class='line1'>Security Level</td>
			<td class='line1'><input type="text"  MAXLENGTH="200"  style="width:600px;" class='inputClass' name="level_id" value="<?php echo $level_id?>"></td>
		</tr>
		<tr>
			<td class='line2'>Enabled</td>
			<td class='line2'>
					<input type="radio" class='inputClass' name="enabled" value="0" <?php echo ($enabled==0?"checked":"")?>> OFF / 
					<input type="radio" class='inputClass' name="enabled" value="1" <?php echo ($enabled==1?"checked":"")?>> ON</td>
		</tr>
		<tr>
			<td colspan="2" class="line1" align='right'><input type="button" value="CANCELAR" class='minorAction' onclick="history.go(-1);">&nbsp;<input type="button" value="SALVAR" class='minorAction' onclick="checkFilled();"></td>
		</tr>
	</table>
</form>
<script type="text/javascript">
	function mySubmit() {
		document.cont.submit();
	};
</script>
</body>
</html>